<template>
  <Row class="banner">
    <Col :span="24">
      <div class="lg:flex">
        <Avatar :src="userinfo.avatar || headerImg" :size="72" class="!mx-auto !block" />
        <div class="md:ml-6 flex flex-col justify-center md:mt-0 mt-2">
          <h1 class="md:text-lg text-md">早安, {{ userinfo.realName }}, 开始您一天的工作吧！</h1>
          <span class="text-secondary"> 今日晴，20℃ - 32℃！ </span>
        </div>
        <div class="flex flex-1 justify-end md:mt-0 mt-4">
          <div class="flex flex-col justify-center text-center">
            <span class="text-secondary">{{
              t('routes.dashboard.workplaceSetting.taskTotal')
            }}</span>
            <span class="text-2xl">10</span>
          </div>

          <div class="flex flex-col justify-center text-center md:mx-16 mx-12">
            <span class="text-secondary">{{
              t('routes.dashboard.workplaceSetting.doneProcess')
            }}</span>
            <span class="text-2xl">82</span>
          </div>
          <div class="flex flex-col justify-center text-center md:mr-10 mr-4">
            <span class="text-secondary">{{
              t('routes.dashboard.workplaceSetting.todoProcess')
            }}</span>
            <span class="text-2xl">30</span>
          </div>
        </div>
      </div>
    </Col>
  </Row>
</template>

<script lang="ts" setup>
  import { computed } from 'vue';
  import { Row, Col, Avatar } from 'ant-design-vue';

  import { useUserStore } from '/@/store/modules/user';
  import headerImg from '/@/assets/images/header.jpg';
  import { useI18n } from '/@/hooks/web/useI18n';

  const { t } = useI18n();

  const userStore = useUserStore();
  const userinfo = computed(() => userStore.getUserInfo);
</script>

<style scoped lang="less">
  .banner {
    width: 100%;
    padding: 20px 20px 0;
    background-color: #fff;
    border-radius: 4px 4px 0 0;
  }
</style>
